package com.education.project.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.education.project.model.LoginUser;

public interface LoginUserMapper {
	public LoginUser getLoginUserByNamePasssword(@Param("loginname")String loginname,@Param("password")String password);
	public List getlimit(@Param("loginUser")LoginUser loginUser,@Param("start")Integer start,@Param("limit")Integer limit);
	public Integer getcount(@Param("loginUser")LoginUser loginUser);
	public LoginUser getLoginUserByLoginname(String loginname);
	public void save(LoginUser loginUser);
	public void update(LoginUser loginUser);
	public void remove(Integer id);
	public Integer getLoginUserCountByUserType(Integer usertypeid);
	@Select("select id from login_user where id=#{id} and password=md5(#{password})")
	Integer getLoginUserPassword(@Param("id") Integer id,@Param("password") String password);
	@Update("update login_user set password=md5(#{password}) where id=#{id}")
	void updateLoginUserPassword(@Param("id") Integer id,@Param("password") String password);
	@Update("update login_user set fullname=#{fullname} where id=#{id}")
	void updateLoginUserFullname(@Param("id") Integer id,@Param("fullname") String fullname);
}
